import App from "./App.vue";
// css
import "./styles/init.less";
import "ant-design-vue/dist/reset.css";
// UI
import { ConfigProvider } from "ant-design-vue";
// Vue工具链
import { createApp } from "vue";
import router from "./router";
import { createPinia } from "pinia";
// qiankun
import { registerMicroApps } from "qiankun";
import { microApps } from "./views/micro-apps/config";

const app = createApp(App);
// 挂载路由
app.use(router);
// 全局主题配置
app.use(ConfigProvider, {
  theme: {
    token: {
      colorPrimary: "#00b96b",
    },
  },
});
// pinia
const pinia = createPinia();
app.use(pinia);

// qiankun注册
registerMicroApps(microApps, {
  beforeLoad: (app) => {
    console.log("Before load app:", app.name);
    return Promise.resolve();
  },
  afterMount: (app) => {
    console.log("After mount app:", app.name);
    return Promise.resolve();
  },
});

app.mount("#app");
